<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 * @package    symfony
 * @subpackage plugin
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: sfGuardUser.php 7633 2008-02-27 17:54:50Z fabien $
 */
class sfGuardUser extends PluginsfGuardUser
{
    public function __call($m, $a)
	{
		$sf_guard_user_profile = $this->getProfile();
		return call_user_func_array(array($sf_guard_user_profile, $m), $a);
	}


  public function checkPassword($password)
  {

    return $this->getPassword() == md5($password);
  }

  public function setPassword($password)
  {
      
      	if ($password !== null && !is_string($password)) {
			$password = (string)$password;
            $password =  md5($password);
		}
		if ($this->password !== md5($password)) {
			$this->password = md5($password);
			$this->modifiedColumns[] = sfGuardUserPeer::PASSWORD;
		}
  }
  public function setPasswordHash($password){
      
    	if ($password !== null && !is_string($password)) {
			$password = (string)$password;
		}
		if ($this->password !== $password) {
			$this->password = $password;
			$this->modifiedColumns[] = sfGuardUserPeer::PASSWORD;
		}

  }


	public function getPassword()
	{

		return $this->password;
	}


  public function setPasswordBis($password)
  {
  }


}
